#
#   FTLES TEST
#

#
#   Copyright (C) 2012
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

from FunctionalBohm import SchrodingerNDT

# Problem setup

from HarmonicOscillator1D import Psi as wvfn
from HarmonicOscillator1D import V
from HarmonicOscillator1D import mass as m
from HarmonicOscillator1D import hbar
from HarmonicOscillator1D import omega

# Initial Conditions
from math import pi

# Use RK4 with Richardson interpolation to propagate statistical ensembles:

S = SchrodingerNDT(V,wvfn,m,dimensions=1,dx=0.000005)

timesteps=2000

FTLES = S.get_FTLES(-3.00,0.0,2.0*pi/omega,timesteps,0.001) 
print(FTLES)

outfile = open("./FTLEs.csv",'w')

for i in range(timesteps):
    outfile.write(str(FTLES[i])+"\n")

outfile.close()